return border;
}
+static void
+resolve_binding_sets (const gchar *value_str,
+ GValue *value)
+{
+ GPtrArray *array;
+ gchar **bindings, **str;
+
+ bindings = g_strsplit (value_str, ",", -1);
+ array = g_ptr_array_new ();
+
+ for (str = bindings; *str; str++)
+ {
+ GtkBindingSet *binding_set;
+
+ binding_set = gtk_binding_set_find (g_strstrip (*str));
+
+ if (!binding_set)
+ continue;
+
+ g_ptr_array_add (array, binding_set);
+ }
+
+ g_value_take_boxed (value, array);
+ g_strfreev (bindings);
+}
+
static gboolean
css_provider_parse_value (GtkCssProvider *css_provider,
const gchar *value_str,
g_param_value_set_default (pspec, val);
g_hash_table_insert (priv->cur_properties, prop, val);
}
+ else if (strcmp (prop, "gtk-key-bindings") == 0)
+ {
+ /* Private property holding the binding sets */
+ resolve_binding_sets (value_str, val);
+ g_hash_table_insert (priv->cur_properties, prop, val);
+ }
else if (pspec->value_type == G_TYPE_STRING)
{
g_value_set_string (val, value_str);
"Transition animation description",
GTK_TYPE_ANIMATION_DESCRIPTION, 0));
+ /* Private property holding the binding sets */
+ gtk_style_properties_register_property (NULL,
+ g_param_spec_boxed ("gtk-key-bindings",
+ "Key bindings",
+ "Key bindings",
+ G_TYPE_PTR_ARRAY, 0));
+
g_type_class_add_private (object_class, sizeof (GtkStylePropertiesPrivate));
}
pango_font_description_merge (font_desc, font_desc_to_merge, replace);
}
+ else if (G_VALUE_TYPE (&data->value) == G_TYPE_PTR_ARRAY &&
+ G_IS_VALUE (value))
+ {
+ GPtrArray *array, *array_to_merge;
+ gint i;
+
+ /* Append the array, mainly thought
+ * for the gtk-key-bindings property
+ */
+ array = g_value_get_boxed (value);
+ array_to_merge = g_value_get_boxed (&data->value);
+
+ for (i = 0; i < array_to_merge->len; i++)
+ g_ptr_array_add (array, g_ptr_array_index (array_to_merge, i));
+ }
else if (replace || !G_IS_VALUE (value))
{
if (!G_IS_VALUE (value))